package com.ljx.rpc.core.provider.impl;

import com.ljx.rpc.core.provider.ServiceProvider;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-10-07  20:20
 */
public class ServiceProviderImpl implements ServiceProvider {

    private static Map<String, Object> serviceMap = new ConcurrentHashMap<>();


    public Object getService(String serviceName){
        return serviceMap.get(serviceName);
    }

    public void addService(String serviceName, Object service){
        serviceMap.put(serviceName, service);
    }
}
